# 学生类
# 1 定义 Student 类
# 2 init方法设置: name, age, gender, mobile, des
# 3 str魔法方法打印个人信息
# 4 测试Student类
# 5 测试把对象属性转成字典 s1.__dict__

class Student(object):
    def __init__(self, name, age, gender, mobile, des):
        self.name = name
        self.age = age
        self.gender = gender
        self.mobile = mobile
        self.des = des

    def __str__(self):
        return f"姓名:{self.name}, 年龄:{self.age}, 性别:{self.gender}, 电话:{self.mobile}, 其他:{self.des}"
        pass


if __name__ == '__main__':
    s1 = Student('张三', 21, '男', '101086', '爱好AI')
    print(s1)

    # 把属性转成字典
    print(s1.__dict__)
    print(type(s1.__dict__))
    pass